import 'package:word_game/engine/core.dart';
import 'equip_event.dart';

enum EquipmentPart {
  head,
  neck,
  shoulder,
  chest,
  back,
  hand,
  waist,
  leg,
  foot,
  finger1,
  finger2,
  master_weapon,
  assist_weapon,
}

class EquipmentPartHelper {
  static List<String> descs = [
    '头',
    '颈',
    '肩',
    '胸',
    '背',
    '手',
    '腰',
    '腿',
    '足',
    '手指1',
    '手指2',
    '主武器',
    '副武器',
  ];
  static List<String> valueStrs = [
    'head',
    'neck',
    'shoulder',
    'chest',
    'back',
    'hand',
    'waist',
    'leg',
    'foot',
    'finger1',
    'finger2',
    'master_weapon',
    'assist_weapon',
  ];
  static descForEnum(EquipmentPart part) {
    int index = EquipmentPart.values.indexOf(part);
    return descs[index];
  }
}

class Equipment extends Thing {
  EquipmentPart belongingPart;

  @override
  Equipment.copy(Equipment old): super.copy(old) {
    belongingPart = old.belongingPart;
  }

  Equipment(Map map) : super(map) {
    add(EquipEvent());
  }
}